package com.pearadmin.modules.sys.service.impl;

import java.util.List;
import java.util.ArrayList;
import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.pearadmin.common.web.domain.request.PageDomain;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.pearadmin.modules.sys.mapper.WorkOperateAnodeHistoryMapper;
import com.pearadmin.modules.sys.domain.WorkOperateAnodeHistory;
import com.pearadmin.modules.sys.service.IWorkOperateAnodeHistoryService;

/**
 * 阳极在位历史记录Service业务层处理
 *
 * @author Mr.Ling
 * @date 2022-01-11
 */
@Service
public class WorkOperateAnodeHistoryServiceImpl implements IWorkOperateAnodeHistoryService {
    @Autowired
    private WorkOperateAnodeHistoryMapper workOperateAnodeHistoryMapper;

    /**
     * 查询阳极在位历史记录
     *
     * @param id 阳极在位历史记录ID
     * @return 阳极在位历史记录
     */
    @Override
    public WorkOperateAnodeHistory selectWorkOperateAnodeHistoryById(String id) {
        return workOperateAnodeHistoryMapper.selectWorkOperateAnodeHistoryById(id);
    }

    /**
     * 查询阳极在位历史记录列表
     *
     * @param workOperateAnodeHistory 阳极在位历史记录
     * @return 阳极在位历史记录
     */
    @Override
    public List<WorkOperateAnodeHistory> selectWorkOperateAnodeHistoryList(WorkOperateAnodeHistory workOperateAnodeHistory) {
        return workOperateAnodeHistoryMapper.selectWorkOperateAnodeHistoryList(workOperateAnodeHistory);
    }

    /**
     * 查询阳极在位历史记录
     * @param workOperateAnodeHistory 阳极在位历史记录
     * @param pageDomain
     * @return 阳极在位历史记录 分页集合
     * */
    @Override
    public PageInfo<WorkOperateAnodeHistory> selectWorkOperateAnodeHistoryPage(WorkOperateAnodeHistory workOperateAnodeHistory, PageDomain pageDomain) {
        PageHelper.startPage(pageDomain.getPage(), pageDomain.getLimit());
        List<WorkOperateAnodeHistory> data = workOperateAnodeHistoryMapper.selectWorkOperateAnodeHistoryList(workOperateAnodeHistory);
        return new PageInfo<>(data);
    }

    /**
     * 新增阳极在位历史记录
     *
     * @param workOperateAnodeHistory 阳极在位历史记录
     * @return 结果
     */

    @Override
    public int insertWorkOperateAnodeHistory(WorkOperateAnodeHistory workOperateAnodeHistory) {
        return workOperateAnodeHistoryMapper.insertWorkOperateAnodeHistory(workOperateAnodeHistory);
    }

    /**
     * 修改阳极在位历史记录
     *
     * @param workOperateAnodeHistory 阳极在位历史记录
     * @return 结果
     */
    @Override
    public int updateWorkOperateAnodeHistory(WorkOperateAnodeHistory workOperateAnodeHistory) {
        return workOperateAnodeHistoryMapper.updateWorkOperateAnodeHistory(workOperateAnodeHistory);
    }

    /**
     * 删除阳极在位历史记录对象
     *
     * @param ids 需要删除的数据ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateAnodeHistoryByIds(String[] ids) {
        return workOperateAnodeHistoryMapper.deleteWorkOperateAnodeHistoryByIds(ids);
    }

    /**
     * 删除阳极在位历史记录信息
     *
     * @param id 阳极在位历史记录ID
     * @return 结果
     */
    @Override
    public int deleteWorkOperateAnodeHistoryById(String id) {
        return workOperateAnodeHistoryMapper.deleteWorkOperateAnodeHistoryById(id);
    }

    @Override
    public WorkOperateAnodeHistory findBySlotAndPole(String slotId, String poleId) {
        return workOperateAnodeHistoryMapper.findBySlotAndPole(slotId,poleId);
    }
}
